home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / coki.swf / scripts / frame_17 / PlaceObject2_102_37 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-10-01  |  2.8 KB  |  121 lines

  1. onClipEvent(enterFrame){
  2.    this._x += Xspeed;
  3.    this._y += Yspeed;
  4.    if(status == 1)
  5.    {
  6.       if(this._x > right || this._x < left)
  7.       {
  8.          Xspeed = - Xspeed;
  9.       }
  10.       if(this._y > bottom || this._y < top)
  11.       {
  12.          Yspeed = - Yspeed;
  13.       }
  14.       if(this.hittest("_root.goal"))
  15.       {
  16.          status = 2;
  17.          _root.insert.nextFrame();
  18.       }
  19.       if(this.hittest("_root.sheep01"))
  20.       {
  21.          if(this._x < _root.sheep01._x && Xspeed > 0)
  22.          {
  23.             Xspeed = - Xspeed;
  24.          }
  25.          if(this._x > _root.sheep01._x && Xspeed < 0)
  26.          {
  27.             Xspeed = - Xspeed;
  28.          }
  29.       }
  30.       if(this.hittest("_root.sheep02"))
  31.       {
  32.          if(this._x < _root.sheep02._x && Xspeed > 0)
  33.          {
  34.             Xspeed = - Xspeed;
  35.          }
  36.          if(this._x > _root.sheep02._x && Xspeed < 0)
  37.          {
  38.             Xspeed = - Xspeed;
  39.          }
  40.       }
  41.       if(this.hittest("_root.sheep03"))
  42.       {
  43.          if(this._x < _root.sheep03._x && Xspeed > 0)
  44.          {
  45.             Xspeed = - Xspeed;
  46.          }
  47.          if(this._x > _root.sheep03._x && Xspeed < 0)
  48.          {
  49.             Xspeed = - Xspeed;
  50.          }
  51.       }
  52.       if(this.hittest("_root.sheep04"))
  53.       {
  54.          if(this._x < _root.sheep04._x && Xspeed > 0)
  55.          {
  56.             Xspeed = - Xspeed;
  57.          }
  58.          if(this._x > _root.sheep04._x && Xspeed < 0)
  59.          {
  60.             Xspeed = - Xspeed;
  61.          }
  62.       }
  63.       if(this.hittest("_root.sheep05"))
  64.       {
  65.          if(this._x < _root.sheep05._x && Xspeed > 0)
  66.          {
  67.             Xspeed = - Xspeed;
  68.          }
  69.          if(this._x > _root.sheep05._x && Xspeed < 0)
  70.          {
  71.             Xspeed = - Xspeed;
  72.          }
  73.       }
  74.       if(this.hittest("_root.sheep06"))
  75.       {
  76.          if(this._x < _root.sheep06._x && Xspeed > 0)
  77.          {
  78.             Xspeed = - Xspeed;
  79.          }
  80.          if(this._x > _root.sheep06._x && Xspeed < 0)
  81.          {
  82.             Xspeed = - Xspeed;
  83.          }
  84.       }
  85.       if(Xspeed > 0)
  86.       {
  87.          this.gotoAndStop("right");
  88.       }
  89.       else
  90.       {
  91.          this.gotoAndStop("left");
  92.       }
  93.       if(this._x > right)
  94.       {
  95.          this._x = _root.area._width - this._width / 2;
  96.       }
  97.       else if(this._x < 0 + this._width / 2)
  98.       {
  99.          this._x = 0 + this._width / 2;
  100.       }
  101.       else if(this._y > bottom)
  102.       {
  103.          this._y = _root.area._height - this._height / 2;
  104.       }
  105.       else if(this._y < 0 + this._height / 2)
  106.       {
  107.          this._y = 0 + this._height / 2;
  108.       }
  109.    }
  110.    else if(status == 2)
  111.    {
  112.       this.gotoAndPlay("clear");
  113.       _root.score -= 1;
  114.    }
  115.    else if(status == 3)
  116.    {
  117.       this._x = -30;
  118.       this._y = -30;
  119.    }
  120. }
  121.